]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Explicitly destroy swipeTracker after emoji panel destruction
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 16 Nov 2022 10:22:18 +0000 (11:22 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 16 Nov 2022 18:06:27 +0000 (18:06 +0000)
Even though the emoji panel may be destroyed with the OSK, the swipeTracker
that is set up to navigate between pages is left lingering, and handling
events for some gestures in the stage. This results in warnings like:

  JS ERROR: TypeError: this._panel is null
  set delta@resource:///org/gnome/shell/ui/keyboard.js:720:9
  _onSwipeUpdate@resource:///org/gnome/shell/ui/keyboard.js:750:22
  _updateGesture@resource:///org/gnome/shell/ui/swipeTracker.js:670:14
  vfunc_gesture_progress@resource:///org/gnome/shell/ui/swipeTracker.js:288>

on touch interaction after the OSK was shown and dismissed. In order to fix
this, issue explicit destruction of the swipeTracker when the emoji pager
actor is destroyed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2543>

js/ui/keyboard.js

index a158425a68b9165bb4379d576f1d5f0361d4f4fa..66f35ea836470f6afd77603492dfec50345353ed 100644 (file)
@@ -685,6 +685,15 @@ var EmojiPager = GObject.registerClass({
         swipeTracker.connect('update', this._onSwipeUpdate.bind(this));
         swipeTracker.connect('end', this._onSwipeEnd.bind(this));
         this._swipeTracker = swipeTracker;
+
+        this.connect('destroy', () => this._onDestroy());
+    }
+
+    _onDestroy() {
+        if (this._swipeTracker) {
+            this._swipeTracker.destroy();
+            delete this._swipeTracker;
+        }
     }
 
     get delta() {